package com.agile.java_seetaface.facedetect;

import com.cnsugar.ai.face.FaceHelper;
import com.cnsugar.ai.face.SeetafaceBuilder;

import java.io.File;
import java.io.IOException;

/**
 * @Author ChenZhangKun
 * @Date 2020/4/15 10:26
 */
public class FaceDetection {
    public static void main(String[] args) throws IOException {
        init();
        float compare = FaceHelper.compare(new File("D:\\czk\\qtproject\\data\\1.jpg"), new File("D:\\czk\\qtproject\\data\\y2.jpg"));
        System.out.println(compare);
    }
    private static void init() {
        SeetafaceBuilder.build();//系统启动时先调用初始化方法

        //等待初始化完成
        while (SeetafaceBuilder.getFaceDbStatus() == SeetafaceBuilder.FacedbStatus.LOADING || SeetafaceBuilder.getFaceDbStatus() == SeetafaceBuilder.FacedbStatus.READY) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
